package cn.miao.controller;

import cn.miao.config.HighlightResultMapper;
import cn.miao.doc.CourseDoc;
import cn.miao.service.ICourseESService;
import cn.miao.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: springcloud-hrm
 * @description:
 * @author: MiaoWei
 * @create: 2021-11-27 21:04
 **/
@RestController
@RequestMapping("/course")
public class CourseESController {
    @Autowired
    private ICourseESService courseService;


    /**
     * 保存或更新
     *
     * @param courseDoc 当然医生
     * @return {@link AjaxResult}
     */
    @PostMapping("/es/save")
    public AjaxResult save(@RequestBody CourseDoc courseDoc) {
        return courseService.saveOrUpdate(courseDoc);
    }


    /**
     * 删除
     *
     * @param id id
     * @return {@link AjaxResult}
     */
    @GetMapping("/es/del")
    public AjaxResult remove(@RequestParam Long id) {
        return courseService.del(id);
    }

    /**
     * 搜索
     *
     * @param id id
     * @return {@link AjaxResult}
     */
    @GetMapping("/es/searchOne")
    public AjaxResult search(@RequestParam Long id) {
        return courseService.search(id);
    }




}
